package com.basksoft.baskreport.demo.dataset;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.lang.math.RandomUtils;

import com.basksoft.report.core.model.dataset.BeanDataset;
import com.basksoft.report.core.model.dataset.impl.BeanContext;
import com.basksoft.report.core.model.dataset.impl.Field;
import com.basksoft.report.core.model.dataset.impl.FieldType;

public class TaskDataset extends BeanDataset {
	@SuppressWarnings("unused")
	private static int number = 1;

	@Override
	public List<?> getData(BeanContext context) {
		List<Map<String,Object>> datas=new ArrayList<Map<String,Object>>();
		Map<String, Object> data = new HashMap<String, Object>();
		data.put("collectionAll", RandomUtils.nextInt(5000000));
		data.put("category1", RandomUtils.nextInt(30));
		data.put("category2", RandomUtils.nextInt(3000));
		data.put("category3", RandomUtils.nextInt(30));
		data.put("category4", RandomUtils.nextInt(30));
		data.put("category5", RandomUtils.nextInt(30));
		data.put("category6", RandomUtils.nextInt(300000));
		datas.add(data);
		return datas;
	}

	@Override
	public List<String> getDependCells() {
		return null;
	}

	@Override
	protected String name() {
		return "执行任务统计";
	}

	@Override
	public List<Field> getFields() {
		List<Field> fields = new ArrayList<Field>();
		fields.add(new Field("collectionAll", FieldType.Integer));
		fields.add(new Field("category1", FieldType.Integer));
		fields.add(new Field("category2", FieldType.Integer));
		fields.add(new Field("category3", FieldType.Integer));
		fields.add(new Field("category4", FieldType.Integer));
		fields.add(new Field("category5", FieldType.Integer));
		fields.add(new Field("category6", FieldType.Integer));
		return fields;
	}

}
